/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

function restauraDadosInterfaceAgendarDefesa(element) {
    var xmlhttp;
    if (window.XMLHttpRequest)
    {
        xmlhttp = new XMLHttpRequest();
    }
    else
    {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.open("GET", "/SisKepler_Gabriel/SolicitaDadosDeDefesa?aluno=" + element, false);
    xmlhttp.send();

    var string = xmlhttp.responseText;
    if (string == null || string=="null") {
        document.getElementById("txtData").defaultValue = " ";
        document.getElementById("txtHorario").defaultValue = " ";
        document.getElementById("txtLocal").defaultValue = " ";
    }
    if (string != null) {
        var array = string.split(",");
        if (array.length == 3) {
            document.getElementById("txtData").defaultValue = array[0];
            document.getElementById("txtHorario").defaultValue = array[1];
            document.getElementById("txtLocal").defaultValue = array[2];
        }
    }
}